<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<title><xti.h></title>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<blockquote>
<h2>Headers and Definitions for XTI</h2>
<xref type="1" name="headersXTI"></xref>
<xref href=prepareapps></xref>
This contains a normative requirement that the contents and structures found in
this document appear in the
<i>&lt;xti.h&gt;</i>
header.
<xref type="1" name="hands"></xref>
<p>
Applications written to compilation environments earlier than
those required by this issue of the specification
and defining _XOPEN_SOURCE to be less than 500, will have these data
structures and constants of certain protocol specific headers
automatically exposed by the inclusion of 
<i>&lt;xti.h&gt;</i>
for compatibility.  The individual protocol-specific appendices 
document the providers for which this may be the case. 
<p>
The function definitions
in this appendix conform to the ISO C standard.
<p>
Values specified for some of the symbolic constants
in this XTI header definition are designated as 
<B>not mandatory</B>
for conformance purposes. These are identified by the comment:
<pre>
<code>
/* value is recommended-only, not mandatory */
</code>
</pre>
in the following definitions.
<p>
<i>&lt;xti.h&gt;</i>
defines t_scalar_t and t_uscalar_t respectively as
a signed and unsigned opaque integral type of equal length of
at least 32 bits.
<p>
Certain items in this appendix are marked 
<B>LEGACY</B>.
This which means that they are being retained for compatibility with older
applications, but have limitations which make them inappropriate for
developing portable applications.
New applications should use alternative means of obtaining equivalent
functionality.
<p>
<pre>
<code>
/*
 * The following are the error codes needed by both the kernel
 * level transport providers and the user level library.
 */
<P><table <tr valign=top><td align=left>#define TBADADDR
<td align=left>1
<td align=left>/* incorrect addr format */
<tr valign=top><td align=left>#define TBADOPT
<td align=left>2
<td align=left>/* incorrect option format */
<tr valign=top><td align=left>#define TACCES
<td align=left>3
<td align=left>/* incorrect permissions */
<tr valign=top><td align=left>#define TBADF
<td align=left>4
<td align=left>/* illegal transport fd */
<tr valign=top><td align=left>#define TNOADDR
<td align=left>5
<td align=left>/* couldn't allocate addr */
<tr valign=top><td align=left>#define TOUTSTATE
<td align=left>6
<td align=left>/* out of state */
<tr valign=top><td align=left>#define TBADSEQ
<td align=left>7
<td align=left>/* bad call sequence number */
<tr valign=top><td align=left>#define TSYSERR
<td align=left>8
<td align=left>/* system error */
<tr valign=top><td align=left>#define TLOOK
<td align=left>9
<td align=left>/* event requires attention */
<tr valign=top><td align=left>#define TBADDATA
<td align=left>10
<td align=left>/* illegal amount of data */
<tr valign=top><td align=left>#define TBUFOVFLW
<td align=left>11
<td align=left>/* buffer not large enough */
<tr valign=top><td align=left>#define TFLOW
<td align=left>12
<td align=left>/* flow control */
<tr valign=top><td align=left>#define TNODATA
<td align=left>13
<td align=left>/* no data */
<tr valign=top><td align=left>#define TNODIS
<td align=left>14
<td align=left>/* discon_ind not found on queue */
<tr valign=top><td align=left>#define TNOUDERR
<td align=left>15
<td align=left>/* unitdata error not found */
<tr valign=top><td align=left>#define TBADFLAG
<td align=left>16
<td align=left>/* bad flags */
<tr valign=top><td align=left>#define TNOREL
<td align=left>17
<td align=left>/* no ord rel found on queue */
<tr valign=top><td align=left>#define TNOTSUPPORT
<td align=left>18
<td align=left>/* primitive/action not supported */
<tr valign=top><td align=left>#define TSTATECHNG
<td align=left>19
<td align=left>/* state is in process of changing */
<tr valign=top><td align=left>#define TNOSTRUCTYPE
<td align=left>20
<td align=left>/* unsupported struct-type requested */
<tr valign=top><td align=left>#define TBADNAME
<td align=left>21
<td align=left>/* invalid transport provider name */
<tr valign=top><td align=left>#define TBADQLEN
<td align=left>22
<td align=left>/* qlen is zero */
<tr valign=top><td align=left>#define TADDRBUSY
<td align=left>23
<td align=left>/* address in use */
<tr valign=top><td align=left>#define TINDOUT
<td align=left>24
<td align=left>/* outstanding connection indications */
<tr valign=top><td align=left>#define TPROVMISMATCH
<td align=left>25
<td align=left>/* transport provider mismatch */
<tr valign=top><td align=left>#define TRESQLEN
<td align=left>26
<td align=left>/* resfd specified to accept w/qlen &gt;0 */
<tr valign=top><td align=left>#define TRESADDR
<td align=left>27
<td align=left>/* resfd not bound to same addr as fd */
<tr valign=top><td align=left>#define TQFULL
<td align=left>28
<td align=left>/* incoming connection queue full */
<tr valign=top><td align=left>#define TPROTO
<td align=left>29
<td align=left>/* XTI protocol error */
</table>
</code>
</pre>
<p>
<br>
<pre>
<code>
/*
 * The following are the events returned.
 */
<P><table <tr valign=top><td align=left>#define T_LISTEN
<td align=left>0x0001
<td align=left>/* connection indication received */
<tr valign=top><td align=left>#define T_CONNECT
<td align=left>0x0002
<td align=left>/* connection confirmation received */
<tr valign=top><td align=left>#define T_DATA
<td align=left>0x0004
<td align=left>/* normal data received */
<tr valign=top><td align=left>#define T_EXDATA
<td align=left>0x0008
<td align=left>/* expedited data received */
<tr valign=top><td align=left>#define T_DISCONNECT
<td align=left>0x0010
<td align=left>/* disconnection received */
<tr valign=top><td align=left>#define T_UDERR
<td align=left>0x0040
<td align=left>/* datagram error indication */
<tr valign=top><td align=left>#define T_ORDREL
<td align=left>0x0080
<td align=left>/* orderly release indication */
<tr valign=top><td align=left>#define T_GODATA
<td align=left>0x0100
<td align=left>/* sending normal data is again possible */
<tr valign=top><td align=left>#define T_GOEXDATA
<td align=left>0x0200
<td align=left>/* sending expedited data is again */
<tr valign=top><td align=left>&quot;/* possible */
</table>
</code>
</pre>
<p>
<pre>
<code>
/*
 * The following are the flag definitions needed by the
 * user level library routines.
 */
<P><table <tr valign=top><td align=left>#define T_MORE
<td align=left>0x001
<td align=left>/* more data */
<tr valign=top><td align=left>#define T_EXPEDITED
<td align=left>0x002
<td align=left>/* expedited data */
<tr valign=top><td align=left>#define T_PUSH
<td align=left>0x004
<td align=left>/* send data immediately */
<tr valign=top><td align=left>#define T_NEGOTIATE
<td align=left>0x004
<td align=left>/* set opts */
<tr valign=top><td align=left>#define T_CHECK
<td align=left>0x008
<td align=left>/* check opts */
<tr valign=top><td align=left>#define T_DEFAULT
<td align=left>0x010
<td align=left>/* get default opts */
<tr valign=top><td align=left>#define T_SUCCESS
<td align=left>0x020
<td align=left>/* successful */
<tr valign=top><td align=left>#define T_FAILURE
<td align=left>0x040
<td align=left>/* failure */
<tr valign=top><td align=left>#define T_CURRENT
<td align=left>0x080
<td align=left>/* get current options */
<tr valign=top><td align=left>#define T_PARTSUCCESS
<td align=left>0x100
<td align=left>/* partial success */
<tr valign=top><td align=left>#define T_READONLY
<td align=left>0x200
<td align=left>/* read-only */
<tr valign=top><td align=left>#define T_NOTSUPPORT
<td align=left>0x400
<td align=left>/* not supported */
</table>
</code>
</pre>
<p>
<pre>
<code>
/*
 *  XTI error return.
 */

/* t_errno is a modifiable lvalue of type int                           */
/* In a single threaded environment a typical definition of t_errno is: */

extern int t_errno;

/* In a multi-threading environment a typical definition of t_errno is: */

extern int *_t_errno(void);
#define t_errno (*(_t_errno()))
</code>
</pre>
<p>
<pre>
<code>
/*
 * iov maximum
 */
#define T_IOV_MAX  16    /* maximum number of scatter/gather buffers */
                         /* value is not mandatory but if present    */
                         /* must be at least 16.                     */

struct  t_iovec {
    void          *iov_base;
    size_t         iov_len;
};
</code>
</pre>
<p>
<pre>
<code>
/* 
 *  XTI LIBRARY FUNCTIONS
 */

/* XTI Library Function: t_accept - accept a connection request*/
extern int t_accept(int, int, const struct t_call *);
/* XTI Library Function: t_alloc - allocate a library structure*/
extern void *t_alloc(int, int, int);
/* XTI Library Function: t_bind - bind an address to a transport endpoint*/
extern int t_bind(int, const struct t_bind *, struct t_bind *);
/* XTI Library Function: t_close - close a transport endpoint*/
extern int t_close(int);
/* XTI Library Function: t_connect - establish a connection */
extern int t_connect(int, const struct t_call *, struct t_call *);
/* XTI Library Function: t_error - produce error message*/
extern int t_error(const char *);
/* XTI Library Function: t_free - free a library structure*/
extern int t_free(void *, int);
/* XTI Library Function: t_getinfo - get protocol-specific service */
                                                      /* information*/
extern int t_getinfo(int, struct t_info *);
/* XTI Library Function: t_getprotaddr - get protocol addresses*/
extern int t_getprotaddr(int, struct t_bind *, struct t_bind *);
/* XTI Library Function: t_getstate - get the current state*/
extern int t_getstate(int);
/* XTI Library Function: t_listen - listen for a connection indication*/
extern int t_listen(int, struct t_call *);
/* XTI Library Function: t_look - look at current event on a transport */
                                                             /* endpoint*/
extern int t_look(int);
/* XTI Library Function: t_open - establish a transport endpoint*/
extern int t_open(const char *, int, struct t_info *);
/* XTI Library Function: t_optmgmt - manage options for a transport */
                                                          /* endpoint*/
extern int t_optmgmt(int, const struct t_optmgmt *,
                              struct t_optmgmt *);
/* XTI Library Function: t_rcv - receive data or expedited data on a */
                                                         /* connection*/
extern int t_rcv(int, void *, unsigned int, int *);
/* XTI Library Function: t_rcvconnect - receive the confirmation from */
                                               /* a connection request */
extern int t_rcvconnect(int, struct t_call *);
/* XTI Library Function: t_rcvdis - retrieve information from disconnect*/
extern int t_rcvdis(int, struct t_discon *);
/* XTI Library Function: t_rcvrel - acknowledge receipt of */
/* an orderly release indication */
extern int t_rcvrel(int);
/* XTI Library Function: t_rcvreldata - receive an orderly release */
                 indication or confirmation containing user data */
extern int t_rcvreldata(int, struct t_discon *discon)
/* XTI Library Function: t_rcvudata - receive a data unit*/
extern int t_rcvudata(int, struct t_unitdata *, int *);
/* XTI Library Function: t_rcvuderr - receive a unit data error indication*/
extern int t_rcvuderr(int, struct t_uderr *);
/* XTI Library Function: t_rcvv - receive data or expedited data sent*/
/*                              over a connection and put the data    */
/*                              into one or more noncontiguous buffers*/
extern int t_rcvv(int, struct t_iovec *, unsigned int, int *);
/* XTI Library Function: t_rcvvudata - receive a data unit into one  */
/*                                       or more noncontiguous buffers*/
extern int t_rcvvudata(int, struct t_unitdata *, struct t_iovec *, \
                                        unsigned int, int *);
/* XTI Library Function: t_snd - send data or expedited data over a */
                                                       /* connection */
extern int t_snd(int, void *, unsigned int, int);
/* XTI Library Function: t_snddis - send user-initiated disconnect request*/
extern int t_snddis(int, const struct t_call *);
/* XTI Library Function: t_sndrel - initiate an orderly release*/
extern int t_sndrel(int);
/* XTI Library Function: t_sndreldata - initiate or respond to an */
                                 /* orderly release with user data */
extern int t_sndreldata(int, struct t_discon *);
/* XTI Library Function: t_sndudata - send a data unit*/
extern int t_sndudata(int, const struct t_unitdata *);
/* XTI Library Function: t_sndv - send data or expedited data,  */
/*            from one or more noncontiguous buffers, on a connection*/
extern int t_sndv(int, const struct t_iovec *, unsigned int iovcount, int);
/* XTI Library Function: t_sndvudata - send a data unit from one or  */
/*                                         more non-contiguous buffers*/
extern int t_sndvudata(int, struct t_unitdata *, struct t_iovec *, unsigned int);
/* XTI Library Function: t_strerror - generate error message string */
extern const char *t_strerror(int);
/* XTI Library Function: t_sync - synchronise transport library*/
extern int t_sync(int);
/* XTI Library Function: t_sysconf - get configurable XTI variables */
extern int t_sysconf(int);
/* XTI Library Function: t_unbind - disable a transport endpoint*/
extern int t_unbind(int);
</code>
</pre>
<p>
<pre>
<code>
/*
 * Protocol-specific service limits.
 */
struct t_info {
  t_scalar_t addr;     /*max size of the transport protocol address         */
  t_scalar_t options;  /*max number of bytes of protocol-specific options   */
  t_scalar_t tsdu;     /*max size of a transport service data unit          */
  t_scalar_t etsdu;    /*max size of expedited transport service data unit  */
  t_scalar_t connect;  /*max amount of data allowed on connection           */
                       /*establishment functions                            */
  t_scalar_t discon;   /*max data allowed on t_snddis and t_rcvdis functions*/
  t_scalar_t servtype; /*service type supported by transport provider       */
  t_scalar_t flags;    /*other info about the transport provider            */
};
</code>
</pre>
<p>
<pre>
<code>
/*
 * Service type defines.
 */
<P><table <tr valign=top><td align=left>#define T_COTS
<td align=left>01
<td align=left>/* connection-mode transport service */
<tr valign=top><td align=left>#define T_COTS_ORD
<td align=left>02
<td align=left>/* connection-mode with orderly release */
<tr valign=top><td align=left>#define T_CLTS
<td align=left>03
<td align=left>/* connectionless-mode transport service */
</table>
</code>
</pre>
<p>
<pre>
<code>
/*
 * Flags defines (other info about the transport provider).
 */
<P><table <tr valign=top><td align=left>#define T_SENDZERO
<td align=left>0x001
<td align=left>/* supports 0-length TSDUs */
<tr valign=top><td align=left>#define T_ORDRELDATA
<td align=left>0x002
<td align=left>/* supports orderly release data */
</table>
</code>
</pre>
<p>
<pre>
<code>
/*
 * netbuf structure.
 */
<P><table <tr valign=top><td align=left>struct netbuf {
<tr valign=top><td align=left>     unsigned int
<td align=left>maxlen;
<tr valign=top><td align=left>     unsigned int
<td align=left>len;
<tr valign=top><td align=left>     void
<td align=left>*buf;
<tr valign=top><td align=left>};
</table>
</code>
</pre>
<p>
<br>
<pre>
<code>
/*
 * t_opthdr structure
 */
struct t_opthdr {
     t_uscalar_t len;      /* total length of option; that is,  */
                           /* sizeof (struct t_opthdr) + length */
                           /* of option value in bytes          */
     t_uscalar_t level;    /* protocol affected                 */
     t_uscalar_t name;     /* option name                       */
     t_uscalar_t status;   /* status value                      */
/* followed by the option value */
};
</code>
</pre>
<p>
<pre>
<code>
/*
 * t_bind - format of the address arguments of bind.
 */
<P><table <tr valign=top><td align=left>struct t_bind {
<tr valign=top><td align=left>     struct netbuf
<td align=left>addr;
<tr valign=top><td align=left>     unsigned int
<td align=left>qlen;
<tr valign=top><td align=left>};
</table>
</code>
</pre>
<p>
<pre>
<code>
/*
 * Options management structure.
 */
<P><table <tr valign=top><td align=left>struct t_optmgmt {
<tr valign=top><td align=left>     struct netbuf
<td align=left>opt;
<tr valign=top><td align=left>     t_scalar_t
<td align=left>flags;
<tr valign=top><td align=left>};
</table>
</code>
</pre>
<p>
<pre>
<code>
/*
 * Disconnection structure.
 */
<P><table <tr valign=top><td align=left>struct t_discon {
<tr valign=top><td align=left>     struct netbuf
<td align=left>udata;
<td align=left>/* user data */
<tr valign=top><td align=left>     int
<td align=left>reason;
<td align=left>/* reason code */
<tr valign=top><td align=left>     int
<td align=left>sequence;
<td align=left>/* sequence number */
<tr valign=top><td align=left>};
</table>
</code>
</pre>
<p>
<pre>
<code>
/*
 * Call structure.
 */
<P><table <tr valign=top><th colspan=3 align=left>struct t_call {
<tr valign=top><td align=left>     struct netbuf
<td align=left>addr;
<td align=left>/* address */
<tr valign=top><td align=left>     struct netbuf
<td align=left>opt;
<td align=left>/* options */
<tr valign=top><td align=left>     struct netbuf
<td align=left>udata;
<td align=left>/* user data */
<tr valign=top><td align=left>     int
<td align=left>sequence;
<td align=left>/* sequence number */
<tr valign=top><td align=left>};
</table>
</code>
</pre>
<p>
<br>
<pre>
<code>
/*
 * Datagram structure.
 */
<P><table <tr valign=top><th colspan=3 align=left>struct t_unitdata {
<tr valign=top><td align=left>     struct netbuf
<td align=left>addr;
<td align=left>/* address */
<tr valign=top><td align=left>     struct netbuf
<td align=left>opt;
<td align=left>/* options */
<tr valign=top><td align=left>     struct netbuf
<td align=left>udata;
<td align=left>/* user data */
<tr valign=top><td align=left>};
</table>
</code>
</pre>
<p>
<br>
<pre>
<code>
/*
 * Unitdata error structure.
 */
<P><table <tr valign=top><td align=left>struct t_uderr {
<tr valign=top><td align=left>     struct netbuf
<td align=left>addr;
<td align=left>/* address */
<tr valign=top><td align=left>     struct netbuf
<td align=left>opt;
<td align=left>/* options */
<tr valign=top><td align=left>     t_scalar_t
<td align=left>error;
<td align=left>/* error code */
<tr valign=top><td align=left>};
</table>
</code>
</pre>
<p>
<pre>
<code>
/*
 * The following are structure types used when dynamically
 * allocating the above structures via t_alloc().
 */
<P><table <tr valign=top><td align=left>#define T_BIND
<td align=left>1
<td align=left>/* struct t_bind */
<tr valign=top><td align=left>#define T_OPTMGMT
<td align=left>2
<td align=left>/* struct t_optmgmt */
<tr valign=top><td align=left>#define T_CALL
<td align=left>3
<td align=left>/* struct t_call */
<tr valign=top><td align=left>#define T_DIS
<td align=left>4
<td align=left>/* struct t_discon */
<tr valign=top><td align=left>#define T_UNITDATA
<td align=left>5
<td align=left>/* struct t_unitdata */
<tr valign=top><td align=left>#define T_UDERROR
<td align=left>6
<td align=left>/* struct t_uderr */
<tr valign=top><td align=left>#define T_INFO
<td align=left>7
<td align=left>/* struct t_info */
</table>
</code>
</pre>
<p>
<pre>
<code>
/*
 * The following bits specify which fields of the above
 * structures should be allocated by t_alloc().
 */
<P><table <tr valign=top><td align=left>#define T_ADDR
<td align=left>0x01
<td align=left>/* address */
<tr valign=top><td align=left>#define T_OPT
<td align=left>0x02
<td align=left>/* options */
<tr valign=top><td align=left>#define T_UDATA
<td align=left>0x04
<td align=left>/* user data */
<tr valign=top><td align=left>#define T_ALL
<td align=left>0xffff
<td align=left>/* all the above fields supported */
</table>
</code>
</pre>
<p>
<br>
<pre>
<code>
/*
 * The following are the states for the user.
 */
<P><table <tr valign=top><td align=left>#define T_UNBND
<td align=left>1
<td align=left>/* unbound */
<tr valign=top><td align=left>#define T_IDLE
<td align=left>2
<td align=left>/* idle */
<tr valign=top><td align=left>#define T_OUTCON
<td align=left>3
<td align=left>/* outgoing connection pending */
<tr valign=top><td align=left>#define T_INCON
<td align=left>4
<td align=left>/* incoming connection pending */
<tr valign=top><td align=left>#define T_DATAXFER
<td align=left>5
<td align=left>/* data transfer */
<tr valign=top><td align=left>#define T_OUTREL
<td align=left>6
<td align=left>/* outgoing release pending */
<tr valign=top><td align=left>#define T_INREL
<td align=left>7
<td align=left>/* incoming release pending */
</table>
</code>
</pre>
<p>
<br>
<pre>
<code>
/*
 * General purpose defines.
 */
<P><table <tr valign=top><td align=left>#define
<td align=left>T_YES
<td align=right>1
<tr valign=top><td align=left>#define
<td align=left>T_NO
<td align=right>0
<tr valign=top><td align=left>#define
<td align=left>T_NULL
<td align=right>0
<tr valign=top><td align=left>#define
<td align=left>T_ABSREQ
<td align=right>0x8000
<tr valign=top><td align=left>#define
<td align=left>T_INFINITE
<td align=right>(-1)
<tr valign=top><td align=left>#define
<td align=left>T_INVALID
<td align=right>(-2)
</table>
</code>
</pre>
<p>
<pre>
<code>
/*
 *  Definitions for t_sysconf
 */
#define _SC_T_IOV_MAX     1  /* value is recommended only, not mandatory */
</code>
</pre>
<p>
<pre>
<code>
/*
 * General definitions for option management
 */
#define T_UNSPEC  (~0 - 2)  /* applicable to u_long, t_scalar_t, char .. */
#define T_ALLOPT  0    /* value is recommended-only, not mandatory */
#define T_ALIGN(p) (((t_uscalar_t)(p) + (sizeof (t_scalar_t) - 1)) \
                                        &amp; ~(sizeof (t_scalar_t) - 1))
#define T_OPT_DATA(tohp)         /* definition to be added           */

#define T_OPT_NEXTHDR(pbuf,buflen,popt) \
        (((char *)(popt) + T_ALIGN((popt)-&gt;len) &lt; \
        (char *)(pbuf) + (buflen)) ? \
        (struct t_opthdr *)((char *)(popt) + T_ALIGN((popt)-&gt;len)) : \
        (struct t_opthdr *)0 )

#define T_OPT_FIRSTHDR(nbp)      /* definition to be added           */
</code>
</pre>
<p>
<pre>
<code>
/* OPTIONS ON XTI LEVEL */

/* 
 *  XTI Level
 * 
 *  The values defined for the XTI Level are recommended-only,
 *  not mandatory.
 */
<P><table <tr valign=top><td align=left>#define
<td align=left>XTI_GENERIC
<td align=left>0xffff
</table>
</code>
</pre>
<p>
<br>
<pre>
<code>
/*
 *  XTI-level Options
 * 
 *  The values defined for these XTI-level Options are recommended-only,
 *  not mandatory.
 */
<P><table <tr valign=top><td align=left>#define
<td align=left>XTI_DEBUG
<td align=left>0x0001
<td align=left>/* enable debugging */
<tr valign=top><td align=left>#define
<td align=left>XTI_LINGER
<td align=left>0x0080
<td align=left>/* linger on close if data present */
<tr valign=top><td align=left>#define
<td align=left>XTI_RCVBUF
<td align=left>0x1002
<td align=left>/* receive buffer size */
<tr valign=top><td align=left>#define
<td align=left>XTI_RCVLOWAT
<td align=left>0x1004
<td align=left>/* receive low-water mark */
<tr valign=top><td align=left>#define
<td align=left>XTI_SNDBUF
<td align=left>0x1001
<td align=left>/* send buffer size */
<tr valign=top><td align=left>#define
<td align=left>XTI_SNDLOWAT
<td align=left>0x1003
<td align=left>/* send low-water mark */
</table>
</code>
</pre>
<p>
<pre>
<code>
/*
 * Structure used with linger option.
 */
struct t_linger {
     t_scalar_t   l_onoff;     /* option on/off */
     t_scalar_t   l_linger;    /* linger time   */
};
</code>
</pre>
<p>
<pre>
<code>
/* SPECIFIC ISO OPTION AND MANAGEMENT PARAMETERS */

/*
* Definition of the ISO transport classes
*/
<P><table <tr valign=top><td align=left>#define
<td align=left>T_CLASS0
<td align=left>0
<tr valign=top><td align=left>#define
<td align=left>T_CLASS1
<td align=left>1
<tr valign=top><td align=left>#define
<td align=left>T_CLASS2
<td align=left>2
<tr valign=top><td align=left>#define
<td align=left>T_CLASS3
<td align=left>3
<tr valign=top><td align=left>#define
<td align=left>T_CLASS4
<td align=left>4
</table>
</code>
</pre>
<p>
<pre>
<code>
/*
 * Definition of the priorities.
 */
<P><table <tr valign=top><td align=left>#define
<td align=left>T_PRITOP
<td align=left>0
<tr valign=top><td align=left>#define
<td align=left>T_PRIHIGH
<td align=left>1
<tr valign=top><td align=left>#define
<td align=left>T_PRIMID
<td align=left>2
<tr valign=top><td align=left>#define
<td align=left>T_PRILOW
<td align=left>3
<tr valign=top><td align=left>#define
<td align=left>T_PRIDFLT
<td align=left>4
</table>
</code>
</pre>
<p>
<pre>
<code>
/*
 * Definitions of the protection levels
 */
<P><table <tr valign=top><td align=left>#define
<td align=left>T_NOPROTECT
<td align=left>1
<tr valign=top><td align=left>#define
<td align=left>T_PASSIVEPROTECT
<td align=left>2
<tr valign=top><td align=left>#define
<td align=left>T_ACTIVEPROTECT
<td align=left>4
</table>
</code>
</pre>
<p>
<pre>
<code>
/*
 * Default value for the length of TPDUs.
 */
<P><table <tr valign=top><td align=left>#define
<td align=left>T_LTPDUDFLT
<td align=left>128
<td align=left>/* define obsolete in XPG4 */
</table>
</code>
</pre>
<p>
<pre>
<code>
/*
 * rate structure.
 */
struct rate {
     t_scalar_t targetvalue;       /* target value */
     t_scalar_t minacceptvalue;    /* value of minimum acceptable quality */
};
</code>
</pre>
<p>
<br>
<pre>
<code>
/*
 * reqvalue structure.
 */
struct reqvalue {
     struct rate    called;    /* called rate */
     struct rate    calling;   /* calling rate */
};
</code>
</pre>
<p>
<br>
<pre>
<code>
/*
 * thrpt structure.
 */
struct thrpt {
     struct reqvalue    maxthrpt;    /* maximum throughput */
     struct reqvalue    avgthrpt;    /* average throughput */
};
</code>
</pre>
<p>
<br>
<pre>
<code>
/*
 * transdel structure
 */
struct transdel {
     struct reqvalue    maxdel;    /* maximum transit delay */
     struct reqvalue    avgdel;    /* average transit delay */
};
</code>
</pre>
<p>
<pre>
<code>
/*
 * Protocol Levels
 * 
 *  The values defined for these Protocol Levels are recommended-only,
 *  not mandatory.
 */
<P><table <tr valign=top><td align=left>#define
<td align=left>T_ISO_TP
<td align=left>0x0100
<tr valign=top><td align=left>#define
<td align=left>ISO_TP
<td align=left>0x0100
<td align=left>(<B>LEGACY</B>)
</table>
</code>
</pre>
<p>
<br>
<pre>
<code>
/*
 *  Options for Quality of Service and Expedited Data (ISO 8072:1994)
 * 
 *  The values defined for these QoS and Expedited Data are 
 *  recommended-only, not mandatory.
 */
<P><table <tr valign=top><td align=left>#define
<td align=left><i>T_TCO_THROUGHPUT</i>
<td align=left>0x0001
<tr valign=top><td align=left>#define
<td align=left><i>TCO_THROUGHPUT</i>
<td align=left>0x0001
<td align=left>(<B>LEGACY</B>)
<tr valign=top><td align=left>#define
<td align=left><i>T_TCO_TRANSDEL</i>
<td align=left>0x0002
<tr valign=top><td align=left>#define
<td align=left><i>TCO_TRANSDEL</i>
<td align=left>0x0002
<td align=left>(<B>LEGACY</B>)
<tr valign=top><td align=left>#define
<td align=left><i>T_TCO_RESERRORRATE</i>
<td align=left>0x0003
<tr valign=top><td align=left>#define
<td align=left><i>TCO_RESERRORRATE</i>
<td align=left>0x0003
<td align=left>(<B>LEGACY</B>)
<tr valign=top><td align=left>#define
<td align=left><i>T_TCO_TRANSFFAILPROB</i>
<td align=left>0x0004
<tr valign=top><td align=left>#define
<td align=left><i>TCO_TRANSFFAILPROB</i>
<td align=left>0x0004
<td align=left>(<B>LEGACY</B>)
<tr valign=top><td align=left>#define
<td align=left><i>T_TCO_ESTFAILPROB</i>
<td align=left>0x0005
<tr valign=top><td align=left>#define
<td align=left><i>TCO_ESTFAILPROB</i>
<td align=left>0x0005
<td align=left>(<B>LEGACY</B>)
<tr valign=top><td align=left>#define
<td align=left><i>T_TCO_RELFAILPROB</i>
<td align=left>0x0006
<tr valign=top><td align=left>#define
<td align=left><i>TCO_RELFAILPROB</i>
<td align=left>0x0006
<td align=left>(<B>LEGACY</B>)
<tr valign=top><td align=left>#define
<td align=left><i>T_TCO_ESTDELAY</i>
<td align=left>0x0007
<tr valign=top><td align=left>#define
<td align=left><i>TCO_ESTDELAY</i>
<td align=left>0x0007
<td align=left>(<B>LEGACY</B>)
<tr valign=top><td align=left>#define
<td align=left><i>T_TCO_RELDELAY</i>
<td align=left>0x0008
<tr valign=top><td align=left>#define
<td align=left><i>TCO_RELDELAY</i>
<td align=left>0x0008
<td align=left>(<B>LEGACY</B>)
<tr valign=top><td align=left>#define
<td align=left><i>T_TCO_CONNRESIL</i>
<td align=left>0x0009
<tr valign=top><td align=left>#define
<td align=left><i>TCO_CONNRESIL</i>
<td align=left>0x0009
<td align=left>(<B>LEGACY</B>)
<tr valign=top><td align=left>#define
<td align=left><i>T_TCO_PROTECTION</i>
<td align=left>0x000a
<tr valign=top><td align=left>#define
<td align=left><i>TCO_PROTECTION</i>
<td align=left>0x000a
<td align=left>(<B>LEGACY</B>)
<tr valign=top><td align=left>#define
<td align=left><i>T_TCO_PRIORITY</i>
<td align=left>0x000b
<tr valign=top><td align=left>#define
<td align=left><i>TCO_PRIORITY</i>
<td align=left>0x000b
<td align=left>(<B>LEGACY</B>)
<tr valign=top><td align=left>#define
<td align=left><i>T_TCO_EXPD</i>
<td align=left>0x000c
<tr valign=top><td align=left>#define
<td align=left><i>TCO_EXPD</i>
<td align=left>0x000c
<td align=left>(<B>LEGACY</B>)
<tr valign=top><td align=left>
<tr valign=top><td align=left>#define
<td align=left><i>T_TCL_TRANSDEL</i>
<td align=left>0x000d
<tr valign=top><td align=left>#define
<td align=left><i>TCL_TRANSDEL</i>
<td align=left>0x000d
<td align=left>(<B>LEGACY</B>)
<tr valign=top><td align=left>#define
<td align=left><i>T_TCL_RESERRORRATE</i>
<td align=left>T_TCO_RESERRORRATE
<tr valign=top><td align=left>#define
<td align=left><i>TCL_RESERRORRATE</i>
<td align=left>T_TCO_RESERRORRATE
<td align=left>(<B>LEGACY</B>)
<tr valign=top><td align=left>#define
<td align=left><i>T_TCL_PROTECTION</i>
<td align=left>T_TCO_PROTECTION
<tr valign=top><td align=left>#define
<td align=left><i>TCL_PROTECTION</i>
<td align=left>T_TCO_PROTECTION
<td align=left>(<B>LEGACY</B>)
<tr valign=top><td align=left>#define
<td align=left><i>T_TCL_PRIORITY</i>
<td align=left>T_TCO_PRIORITY
<tr valign=top><td align=left>#define
<td align=left><i>TCL_PRIORITY</i>
<td align=left>T_TCO_PRIORITY
<td align=left>(<B>LEGACY</B>)
</table>
</code>
</pre>
<p>
<br>
<pre>
<code>
/*
 *  Management Options
 * 
 *  The values defined for these Management Options are 
 *  recommended-only, not mandatory.
 */
<P><table <tr valign=top><td align=left>#define
<td align=left><i>T_TCO_LTPDU</i>
<td align=left>0x0100
<tr valign=top><td align=left>#define
<td align=left><i>TCO_LTPDU</i>
<td align=left>0x0100
<tr valign=top><td align=left>#define
<td align=left><i>T_TCO_ACKTIME</i>
<td align=left>0x0200
<tr valign=top><td align=left>#define
<td align=left><i>TCO_ACKTIME</i>
<td align=left>0x0200
<tr valign=top><td align=left>#define
<td align=left><i>T_TCO_REASTIME</i>
<td align=left>0x0300
<tr valign=top><td align=left>#define
<td align=left><i>TCO_REASTIME</i>
<td align=left>0x0300
<tr valign=top><td align=left>#define
<td align=left><i>T_TCO_EXTFORM</i>
<td align=left>0x0400
<tr valign=top><td align=left>#define
<td align=left><i>TCO_EXTFORM</i>
<td align=left>0x0400
<tr valign=top><td align=left>#define
<td align=left><i>T_TCO_FLOWCTRL</i>
<td align=left>0x0500
<tr valign=top><td align=left>#define
<td align=left><i>TCO_FLOWCTRL</i>
<td align=left>0x0500
<tr valign=top><td align=left>#define
<td align=left><i>T_TCO_CHECKSUM</i>
<td align=left>0x0600
<tr valign=top><td align=left>#define
<td align=left><i>TCO_CHECKSUM</i>
<td align=left>0x0600
<tr valign=top><td align=left>#define
<td align=left><i>T_TCO_NETEXP</i>
<td align=left>0x0700
<tr valign=top><td align=left>#define
<td align=left><i>TCO_NETEXP</i>
<td align=left>0x0700
<tr valign=top><td align=left>#define
<td align=left><i>T_TCO_NETRECPTCF</i>
<td align=left>0x0800
<tr valign=top><td align=left>#define
<td align=left><i>TCO_NETRECPTCF</i>
<td align=left>0x0800
<tr valign=top><td align=left>#define
<td align=left><i>T_TCO_PREFCLASS</i>
<td align=left>0x0900
<tr valign=top><td align=left>#define
<td align=left><i>TCO_PREFCLASS</i>
<td align=left>0x0900
<tr valign=top><td align=left>#define
<td align=left><i>T_TCO_ALTCLASS1</i>
<td align=left>0x0a00
<tr valign=top><td align=left>#define
<td align=left><i>TCO_ALTCLASS1</i>
<td align=left>0x0a00
<tr valign=top><td align=left>#define
<td align=left><i>T_TCO_ALTCLASS2</i>
<td align=left>0x0b00
<tr valign=top><td align=left>#define
<td align=left><i>TCO_ALTCLASS2</i>
<td align=left>0x0b00
<tr valign=top><td align=left>#define
<td align=left><i>T_TCO_ALTCLASS3</i>
<td align=left>0x0c00
<tr valign=top><td align=left>#define
<td align=left><i>TCO_ALTCLASS3</i>
<td align=left>0x0c00
<tr valign=top><td align=left>#define
<td align=left><i>T_TCO_ALTCLASS4</i>
<td align=left>0x0d00
<tr valign=top><td align=left>#define
<td align=left><i>TCO_ALTCLASS4</i>
<td align=left>0x0d00
<tr valign=top><td align=left>
<tr valign=top><td align=left>#define
<td align=left><i>T_TCL_CHECKSUM</i>
<td align=left>T_TCO_CHECKSUM
<tr valign=top><td align=left>#define
<td align=left><i>TCL_CHECKSUM</i>
<td align=left>T_TCO_CHECKSUM
</table>
</code>
</pre>
<p>
<pre>
<code>
/* INTERNET-SPECIFIC ENVIRONMENT */

/*
 *  TCP level
 * 
 *  The values defined for the TCP Level are recommended-only, 
 *  not mandatory.
 */
<P><table <tr valign=top><td align=left>#define
<td align=left>T_INET_TCP
<td align=left>0x6
<tr valign=top><td align=left>#define
<td align=left>INET_TCP
<td align=left>0x6
<td align=left>(<B>LEGACY</B>)
</table>
</code>
</pre>
<p>
<br>
<pre>
<code>
/*
 *  TCP-level Options
 * 
 *  The values defined for the TCP-level Options are recommended-only, 
 *  not mandatory.
 */
<P><table <tr valign=top><td align=left>#define
<td align=left>T_TCP_NODELAY
<td align=left>0x1
<td align=left>/* don't delay packets to coalesce */
<tr valign=top><td align=left>#define
<td align=left>TCP_NODELAY
<td align=left>0x1
<td align=left>/* (<B>LEGACY</B>)                  */
<tr valign=top><td align=left>#define
<td align=left>T_TCP_MAXSEG
<td align=left>0x2
<td align=left>/* get maximum segment size */
<tr valign=top><td align=left>#define
<td align=left>TCP_MAXSEG
<td align=left>0x2
<td align=left>/* (<B>LEGACY</B>)                */ 
<tr valign=top><td align=left>#define
<td align=left>T_TCP_KEEPALIVE
<td align=left>0x8
<td align=left>/* check, if connections are alive */
<tr valign=top><td align=left>#define
<td align=left>TCP_KEEPALIVE
<td align=left>0x8
<td align=left>/* (<B>LEGACY</B>)                  */
</table>
</code>
</pre>
<p>
<pre>
<code>
/*
 * Structure used with TCP_KEEPALIVE option.
 */
struct t_kpalive {
     t_scalar_t    kp_onoff;      /* option on/off      */
     t_scalar_t    kp_timeout;    /* timeout in minutes */
};
</code>
</pre>
<p>
<pre>
<code>
<P><table <tr valign=top><td align=left>#define
<td align=left>T_GARBAGE
<td align=left>0x02
<td align=left>/*     <B>LEGACY</B>        */
<tr valign=top><td align=left>
</table>
</code>
</pre>
<p>
<pre>
<code>
/*
 *  UDP level
 * 
 *  The values defined for the UDP Level are recommended-only, 
 *  not mandatory.
 */
<P><table <tr valign=top><td align=left>#define
<td align=left>T_INET_UDP
<td align=left>0x11
<tr valign=top><td align=left>#define
<td align=left>INET_UDP
<td align=left>0x11
<td align=left>(<B>LEGACY</B>)
</table>
</code>
</pre>
<p>
<br>
<pre>
<code>
/*
 *  UDP-level Options
 * 
 *  The values defined for the UDP-level Options are recommended-only, 
 *  not mandatory.
 */
<P><table <tr valign=top><td align=left>#define
<td align=left>T_UDP_CHECKSUM
<td align=left>T_TCO_CHECKSUM
<td align=left>/* checksum computation */
<tr valign=top><td align=left>#define
<td align=left>UDP_CHECKSUM
<td align=left>T_TCO_CHECKSUM
<td align=left>/* <B>LEGACY</B>              */
</table>
</code>
</pre>
<p>
<pre>
<code>
/*
 *  IP level
 * 
 *  The values defined for the IP Level are recommended-only, 
 *  not mandatory.
 */
<P><table <tr valign=top><td align=left>#define
<td align=left>T_INET_IP
<td align=left>0x0
<tr valign=top><td align=left>#define
<td align=left>INET_IP
<td align=left>0x0
<td align=left>(<B>LEGACY</B>)
</table>
</code>
</pre>
<p>
<pre>
<code>
/*
 *  IP-level Options
 * 
 *  The values defined for the IP-level Options are recommended-only, 
 *  not mandatory.
 */
<P><table <tr valign=top><td align=left>#define
<td align=left>T_IP_OPTIONS
<td align=left>0x1
<td align=left>/* IP per-packet options */
<tr valign=top><td align=left>#define
<td align=left>IP_OPTIONS
<td align=left>0x1
<td align=left>/* (<B>LEGACY</B>)         */
<tr valign=top><td align=left>#define
<td align=left>T_IP_TOS
<td align=left>0x2
<td align=left>/* IP per-packet type of service */
<tr valign=top><td align=left>#define
<td align=left>IP_TOS
<td align=left>0x2
<td align=left>/* (<B>LEGACY</B>)                */
<tr valign=top><td align=left>#define
<td align=left>T_IP_TTL
<td align=left>0x3
<td align=left>/* IP per-packet time to live */
<tr valign=top><td align=left>#define
<td align=left>IP_TTL
<td align=left>0x3
<td align=left>/* (<B>LEGACY</B>)              */ 
<tr valign=top><td align=left>#define
<td align=left>T_IP_REUSEADDR
<td align=left>0x4
<td align=left>/* allow local address reuse */
<tr valign=top><td align=left>#define
<td align=left>IP_REUSEADDR
<td align=left>0x4
<td align=left>/* (<B>LEGACY</B>)            */
<tr valign=top><td align=left>#define
<td align=left>T_IP_DONTROUTE
<td align=left>0x10
<td align=left>/* just use interface addresses */
<tr valign=top><td align=left>#define
<td align=left>IP_DONTROUTE
<td align=left>0x10
<td align=left>/* (<B>LEGACY</B>)               */
<tr valign=top><td align=left>#define
<td align=left>T_IP_BROADCAST
<td align=left>0x20
<td align=left>/* permit sending of broadcast msgs */
<tr valign=top><td align=left>#define
<td align=left>IP_BROADCAST
<td align=left>0x20
<td align=left>/* (<B>LEGACY</B>)                  */
</table>
</code>
</pre>
<p>
<br>
<pre>
<code>
/*
 * IP_TOS precedence levels
 */
<P><table <tr valign=top><td align=left>#define
<td align=left>T_ROUTINE
<td align=left>0
<tr valign=top><td align=left>#define
<td align=left>T_PRIORITY
<td align=left>1
<tr valign=top><td align=left>#define
<td align=left>T_IMMEDIATE
<td align=left>2
<tr valign=top><td align=left>#define
<td align=left>T_FLASH
<td align=left>3
<tr valign=top><td align=left>#define
<td align=left>T_OVERRIDEFLASH
<td align=left>4
<tr valign=top><td align=left>#define
<td align=left>T_CRITIC_ECP
<td align=left>5
<tr valign=top><td align=left>#define
<td align=left>T_INETCONTROL
<td align=left>6
<tr valign=top><td align=left>#define
<td align=left>T_NETCONTROL
<td align=left>7
</table>
</code>
</pre>
<p>
<pre>
<code>
/*
 * IP_TOS type of service
 */
<P><table <tr valign=top><td align=left>#define
<td align=left>T_NOTOS
<td align=left>0
<tr valign=top><td align=left>#define
<td align=left>T_LDELAY
<td align=left>(1 &lt;&lt; 4)
<tr valign=top><td align=left>#define
<td align=left>T_HITHRPT
<td align=left>(1 &lt;&lt; 3)
<tr valign=top><td align=left>#define
<td align=left>T_HIREL
<td align=left>(1 &lt;&lt; 2)
<tr valign=top><td align=left>#define
<td align=left>T_LOCOST
<td align=left>(1 &lt;&lt; 1)
<tr valign=top><td align=left>
<tr valign=top><td align=left>#define
<td align=left>SET_TOS(prec, tos)
<td align=left>((0x7 &amp; (prec)) &lt;&lt; 5 | (0x1c &amp; (tos)))
</table>
</code>
</pre>
<br>
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>
